package com.vastcom.tyauthcenter.config;



import com.vastcom.tyauthcenter.tools.JwtUtil;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class FeiginAdminConfig implements RequestInterceptor {

    private String generateAdminToken(){
        String token= JwtUtil.generateToken("admin","authcenter");

        return token;
    }

    @Override
    public void apply(RequestTemplate requestTemplate) {
        String token=generateAdminToken();
        requestTemplate.header("Content-Type", "application/json");
        requestTemplate.header("Accept", "application/json");
        requestTemplate.header("Passport", token);
    }
}

